var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
import { toast } from "./../toast";
import { setClipboard as clipboard } from "fan-utils";
function clipboardSuccess() {
  toast.success("\u590D\u5236\u6210\u529F");
}
function clipboardError() {
  toast("\u590D\u5236\u5931\u8D25");
}
const setClipboard = (txt, options) => __async(void 0, null, function* () {
  try {
    yield clipboard(txt);
    (options == null ? void 0 : options.success) ? options.success() : clipboardSuccess();
  } catch (e) {
    (options == null ? void 0 : options.error) ? options.error(e) : clipboardError();
  }
});
export {
  setClipboard
};
